//
//  ChessBoardMgr.m
//  airplane
//
//  Created by gump gump on 6/12/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "ChessBoardMgr.h"
#import "Chess.h"

@implementation ChessBoardMgr

static ChessBoardMgr *CBManager = nil;

@synthesize vertexWriteArr;
@synthesize vertexGreenArr;

-(void)dealloc
{
    [super dealloc];
    
    [vertexWriteArr release];
    [vertexGreenArr release];
}

+ (ChessBoardMgr*)sharedManager
{   
    if (CBManager == nil)  
    {   
        CBManager = [[super allocWithZone:NULL] init];   
    }   
    return CBManager;
}

+(void)releaseManager
{
    if(CBManager != nil)
    {
        [CBManager release];
        CBManager = nil;
    }
}

-(void) initArr
{
    vertexWriteArr = [[NSMutableArray alloc] init];
    vertexGreenArr = [[NSMutableArray alloc] init];
    
    for (int i = 0; i < 5; ++i) 
    {
        Chess *chess = [Chess alloc];
        chess.vertexPt = CGPointMake(10 * i,10 * i);
        chess.colorType = WRITE_CHESS_CT;
        
        [vertexWriteArr addObject:chess];
        [chess release];
    }
    
}

@end
